import request from "utils/request";
import {handleSearchValue} from "utils";
import {searchField} from './InitTemplate';

//定义接口地址
const URL = {
    "normalUrl": `${GROBAL_HTTP_CTXR}mrjt/ncquery/poorderQuery`, //列表接口
    "queryDeal": `${GROBAL_HTTP_CTXIn}cmp-informer/findListById`,
    "selectUrl": `${GROBAL_HTTP_CTXSu}cust-doc-defs/cust_doc_code/batch`,
}

export const queryDeal = (param) => {
    return request(URL.queryDeal, {
        method: "get",
        param: {id:param}
    });
}

export const getSelectData = (param) => {
    return request(URL.selectUrl, {
        method: "get",
        param: {cust_doc_code_batch:param.toString()}
    });
}


/**
 * 获取列表
 * @param {*} params
 */
export const getList = (param) => {
    let value = handleSearchValue(param,searchField);
    return request(URL.normalUrl, {
        method: "get",
        param: value
    });
}


